package ru.eas.multiplication;


import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author aesipov
 */
public class KaratsubaMultiplication {

    public static final int RADIX = 1000000000;
    public static final int RADIX_DIGIT_COUNT = 9;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String xString  = scanner.next();
        String yString = scanner.next();
//        String xString = "239030239030566179";
//        String yString = "56617956617923930";

//        long p_1 = System.currentTimeMillis();
//        String xString = testData();
//        String yString = testData();

        int[] x = stringToNumberArray(xString);
        int[] y = stringToNumberArray(yString);

        int[] result = karatsuba(x, y, RADIX);

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < result.length; i++) {
            String str = String.valueOf(result[i]);
            if (i != 0) {
                for (int j = 0; j < RADIX_DIGIT_COUNT - str.length(); j++) {
                    sb.append("0");
                }
            }
            sb.append(str);
        }
        System.out.println(sb.toString());

//        long p_2 = System.currentTimeMillis();
//        System.out.println("common = " + (p_2 - p_1));
//        System.out.println("13533403703804583268316967452763470");
    }

    private static String testData() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 100000; i++) {
             sb.append(9);
        }
        return sb.toString();
    }

    private static int[] stringToNumberArray(String numberString) {
        int len = numberString.length() / RADIX_DIGIT_COUNT;
        int length = numberString.length() % RADIX_DIGIT_COUNT == 0 ? len : 1 + len;
        int[] result = new int[length];
        int index = length - 1;
        for (int i = numberString.length(); i >= 0 ; i = i - RADIX_DIGIT_COUNT) {
            int left = i - RADIX_DIGIT_COUNT;
            int right = i;
            if (left > 0) {
                result[index] = Integer.valueOf(numberString.substring(left, right));
                index--;
            } else {
                result[index] = Integer.valueOf(numberString.substring(0, right));
                break;
            }
        }
        return result;
    }

    private static int[] karatsuba(int[] x, int[] y, int radix) {
//        System.out.println("x = " + Arrays.toString(x));
//        System.out.println("y = " + Arrays.toString(y));

        int n = Math.max(x.length, y.length);
        if (n == 1) {
            int[] result = longNumberToByteArray((long) x[0] * (long) y[0], radix);
//            System.out.println("r = " + Arrays.toString(result));
            return result;
        }

        int floorHalfN = n / 2;

        int[] xLeft = getLeft(x, floorHalfN);
        int[] xRight = getRight(x, floorHalfN);
        int[] yLeft = getLeft(y, floorHalfN);
        int[] yRight = getRight(y, floorHalfN);

//        System.out.println(Arrays.toString(xLeft));
//        System.out.println(Arrays.toString(xRight));
//        System.out.println(Arrays.toString(yLeft));
//        System.out.println(Arrays.toString(yRight));

        int[] p1 = karatsuba(xLeft, yLeft, radix);
        int[] p2 = karatsuba(xRight, yRight, radix);
        int[] p3 = karatsuba(plus(xLeft, xRight, radix), plus(yLeft, yRight, radix), radix);

//        System.out.print("p1 = ");
//        System.out.println(Arrays.toString(p1));
//        System.out.print("p2 = ");
//        System.out.println(Arrays.toString(p2));
//        System.out.print("p3 = ");
//        System.out.println(Arrays.toString(p3));

        int[] r1 = concatenateArrays(p1, new int[2 * floorHalfN]);
//        int[] r2 = plus(plus(p3, negative(p1), radix), negative(p2), radix);
        int[] r2 = minus(minus(p3, p1, radix), p2, radix);
        int[] r3 = concatenateArrays(r2, new int[floorHalfN]);

//        System.out.print("r1 = ");
//        System.out.println(Arrays.toString(r1));
//        System.out.print("r2 = ");
//        System.out.println(Arrays.toString(r2));
//        System.out.print("r3 = ");
//        System.out.println(Arrays.toString(r3));


        int[] result = plus(plus(r1, r3, radix), p2, radix);

//        System.out.println("p4 = " + (p_4 - p_1));
//        System.out.println("p5 = " + (p_5 - p_4));
//        System.out.println("p6 = " + (p_6 - p_5));
//        System.out.println("p7 = " + (p_7 - p_6));

//        System.out.println("r = " + Arrays.toString(result));

        return result;
    }

    private static int[] longNumberToByteArray(long number, int radix) {
        List<Integer> result = new ArrayList<Integer>();
        while(number != 0) {
            result.add((int) (number % radix));
            number /= radix;
        }
        int[] array = new int[result.size()];
        for (int i = 0; i < array.length; i++) {
            array[i] = result.get(array.length - i - 1);
        }
        return array;
    }

    private static int[] plus(int[] x, int[] y, int radix) {
        int lengthDifference = Math.abs(x.length - y.length);
        if (x.length > y.length) {
            y = concatenateArrays(new int[lengthDifference], y);
        }
        if (x.length < y.length) {
            x = concatenateArrays(new int[lengthDifference], x);
        }
        //invariant: y.length == x.length;

        int[] result = new int[x.length];
        int inMind = 0;
        for (int i = x.length - 1; i >= 0; i--) {
            int sum = x[i] + y[i] + inMind;
            int digit = sum % radix;
            if (digit >= 0) {
                result[i] = digit;
                inMind = sum / radix;
            } else {
                result[i] = radix + digit;
                inMind = sum / radix - 1;
            }
        }
        if (inMind != 0) {
            result = concatenateArrays(new int[]{inMind}, result);
        }
        return result;
    }

    private static int[] minus(int[] x, int[] y, int radix) {
        int lengthDifference = Math.abs(x.length - y.length);
        if (x.length > y.length) {
            y = concatenateArrays(new int[lengthDifference], y);
        }
        if (x.length < y.length) {
            x = concatenateArrays(new int[lengthDifference], x);
        }
        //invariant: y.length == x.length;

        int[] result = new int[x.length];
        int inMind = 0;
        for (int i = x.length - 1; i >= 0; i--) {
            int sum = x[i] - y[i] + inMind;
            int digit = sum % radix;
            if (digit >= 0) {
                result[i] = digit;
                inMind = sum / radix;
            } else {
                result[i] = radix + digit;
                inMind = sum / radix - 1;
            }
        }
        if (inMind != 0) {
            result = concatenateArrays(new int[]{inMind}, result);
        }
        return result;
    }

    public static int[] concatenateArrays(int[] a,
                                          int[] b)
    {
        int[] result = new int[a.length + b.length];
        System.arraycopy(a, 0, result, 0, a.length);
        System.arraycopy(b, 0, result, a.length, b.length);
        return result;
    }

    private static int[] getLeft(int[] number, int rightLength) {
        int[] result;
        int bitCount = number.length - rightLength;
        if (bitCount > 0) {
            result = new int[bitCount];
            System.arraycopy(number, 0, result, 0, bitCount);
        } else {
            result = new int[] {0};
        }
        return result;
    }

    private static int[] getRight(int[] number, int rightLength) {
        int[] result;
        result = new int[rightLength];

        if (rightLength <= number.length) {
            System.arraycopy(number, number.length - rightLength, result, 0, rightLength);
        } else {
            result = concatenateArrays(new int[rightLength - number.length], number);
        }
        return result;
    }
}
